<!--  -->
<template>
  <div class="">
    <el-form ref="form" :model="form" label-width="80px">
      

      <el-form-item label="退役时间" prop="time">
        <el-col>
          <el-date-picker
            type="date"
            placeholder="选择日期"
            v-model="form.time"
            value-format="yyyy-MM-dd hh:mm:ss"
            style="width: 100%"
          ></el-date-picker>
        </el-col>
      </el-form-item>

      <el-form-item label="退役去向" prop="go">
        <el-input type="textarea" v-model="form.go" placeholder="请输入退役去向"></el-input>
      </el-form-item>
      <el-form-item label="退役状态">
        <el-input  v-model="form.status?'已同意':'申请中'" disabled></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">提交申请</el-button>
        <el-button @click="cancel('form')">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
    
    <script>
    import {addRetirement} from '@/api'
export default {
  components: {},
  data() {
    return {
      form: {
        go:'',
        time:'',
        status:-1,
        nick:JSON.parse(localStorage.getItem('userInfo')).nick
      },
    };
  },
  computed: {},
  watch: {},
  methods: {
    cancel(form){
       this.$refs[form].resetFields();
    },
    onSubmit(){
      addRetirement(this.form).then(res=>{
        if(res.code==200){
          this.$message.success('提交成功')
        }else{
          this.$message.error('提交失败')
        }
      })
    
    }
  },
  created() {},
  mounted() {},
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  activated() {},
};
</script>
    <style  scoped>
</style>